<template>
 <div>
  御剑乘风来,除魔天地间!===app==={{s}}
  <RefCom ref="boxF"></RefCom>
  <h1 ref="dom" v-if="flag">我是h1</h1>
  <button @click="handel">点击让h1显示或者隐藏</button>
 </div>
</template>
<script>
import RefCom from './ref/RefCom.vue'
export default{
  components:{RefCom},
    name:'',
    data () {
        return { 
          s:'',
          flag:true
           }
    },
    created () {
    },
    computed:{
    },
    methods:{
      handel(){
        this.flag=!this.flag
        // console.log(this.$refs.dom,666)
        this.$nextTick(()=>{
          console.log(this.$refs.dom,666)

        })
      }
    },
    mounted() {
      //this.$refs.boxF===RefCom组件的this
      console.log(this.$refs.boxF);
      this.s=this.$refs.boxF.msg
      // console.log(this.$refs.dom)
    },
}
</script>
<style lang='less'  scoped>
    
</style>
